#include<stdio.h>
#include<string.h>
void exchange(char*arr1,char*arr2,int len)
{
	int i = 0;
	
	for (i = 0; i < 5; i++)
	{
		int temp;
		temp = *arr1;
		*arr1 = *arr2;
		*arr2 = temp;
		arr1++;
		arr2++;
	}
	
}
int main()
{
	char arr1[10];
	char arr2[10];
	scanf_s("%s", arr1,sizeof(arr1));
	scanf_s("%s", arr2, sizeof(arr2));
	int len = sizeof(arr1);
	exchange(arr1, arr2,len);
	printf("%s\n", arr1);
	printf("%s", arr2);

}
/*int main()
{
	int arr1[5] = { 1,2,3 };
	int arr2[5] = { 4,5,6 };
	//int len = sizeof(arr1);
	//exchange(arr1[5], arr2[5]);
	int i = 0;


	for (i = 0; i < 3; i++)
	{
		int a;
		a = arr1[i];
		arr1[i] = arr2[i];
		arr2[i] = a;

	}
	for (i = 0; i < 3; i++)
	{
		printf("%d", arr1[i]);
	}

	
	return 0;
}*/